-- CALC_RESIDENCE_BONUS

-- 民居奖励
return function(user, bonusArg)
    -- 必定获得：红包×1~2
    -- 随机获得一项：糖果×3、春联×2、饺子×2、灯笼×1
    local bonus = {};
    local rand1 = DungeonM.getRandSeed("CALC_RESIDENCE_BONUS") % 2 + 1;
    local rand2 = DungeonM.getRandSeed("CALC_RESIDENCE_BONUS") % 1000;

    table.insert(bonus, {1, 1514, rand1});
    local arr = {
        {["bonus"] = {1,7634,3}, ["ratio"] = 27},
        {["bonus"] = {1,7635,2}, ["ratio"] = 27},
        {["bonus"] = {1,7633,2}, ["ratio"] = 27},
        {["bonus"] = {1,7636,1}, ["ratio"] = 20},
    };
    table.insert(bonus, fetchElemBySeed(arr, rand2)["bonus"]);

    return bonus;
end
